/**
 * Note: The returned array must be malloced, assume caller calls free().
 */

int* twoSum(int* nums, int numsSize, int target, int* returnSize)
{
    int index1 = 0, index2 = 0, flag = 0;
    for (int i = 0; i < numsSize; i++)
    {
        for (int j = i + 1; j < numsSize; j++)
        {
            if (nums[i] + nums[j] == target)
            {
                index1 = i;
                index2 = j;
                break;
                flag = 1;
            }
            else
                continue;
        }
        if (flag)
            break;
    }
    int* a = (int*)malloc(sizeof(int) * 2);
    a[0] = index1;
    a[1] = index2;
    *returnSize = 2;
    return a;
}